set(HSAILASM $<TARGET_FILE:HSAILasm>)
if (MSVC)
  set(RUNTEST ${CMAKE_CURRENT_SOURCE_DIR}/run_test.cmd)
else()
  set(RUNTEST ${CMAKE_CURRENT_SOURCE_DIR}/run_test)
endif()

macro(syntax_test name)
  add_test(NAME 1.0/syntax/${name}
           COMMAND ${RUNTEST} ${HSAILASM} ${name} ${CMAKE_CURRENT_SOURCE_DIR}
           WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endmacro()

syntax_test(000_empty_1)
syntax_test(000_inst_image_large)
syntax_test(000_inst_image_small)
syntax_test(000_inst_large)
syntax_test(000_inst_large_base)
syntax_test(000_inst_small)
syntax_test(001_delimiters)
syntax_test(001_order_1)
syntax_test(001_order_2)
syntax_test(001_order_3)
syntax_test(002_version_large)
syntax_test(002_version_small)
syntax_test(003_pragma)
syntax_test(004_extension)
syntax_test(004_extension_CORE)
syntax_test(004_extension_CORE_0)
syntax_test(005_control_00)
syntax_test(005_control_01)
syntax_test(005_control_02)
syntax_test(005_control_03)
syntax_test(005_control_04)
syntax_test(005_control_05)
syntax_test(005_control_06)
syntax_test(005_control_07)
syntax_test(005_control_08)
syntax_test(005_control_09)
syntax_test(005_control_10)
syntax_test(005_control_enablebreakexceptions_1)
syntax_test(005_control_enablebreakexceptions_2)
syntax_test(005_control_enabledetectexceptions_1)
syntax_test(005_control_enabledetectexceptions_2)
syntax_test(005_control_maxdynamicgroupsize)
syntax_test(005_control_maxflatgridsize_1)
syntax_test(005_control_maxflatgridsize_2)
syntax_test(005_control_maxflatworkgroupsize_1)
syntax_test(005_control_maxflatworkgroupsize_2)
syntax_test(005_control_requireddim)
syntax_test(005_control_requiredgridsize_1)
syntax_test(005_control_requiredgridsize_2)
syntax_test(005_control_requiredworkgroupsize_1)
syntax_test(005_control_requiredworkgroupsize_2)
syntax_test(006_loc)
syntax_test(009_function_arg_align)
syntax_test(009_function_arg_array)
syntax_test(009_function_arg_flexible_array)
syntax_test(009_function_arg_generic)
syntax_test(009_function_arg_generic_base)
syntax_test(009_function_arg_passing)
syntax_test(009_function_decl)
syntax_test(009_function_forw_decl)
syntax_test(009_function_generic)
syntax_test(009_function_indirect)
syntax_test(009_function_indirect_small)
syntax_test(009_function_module)
syntax_test(009_function_signature_0)
syntax_test(009_function_signature_1)
syntax_test(009_function_width)
syntax_test(010_kernel_args)
syntax_test(010_kernel_decl)
syntax_test(010_kernel_generic)
syntax_test(010_kernel_module)
syntax_test(011_argscope_generic)
syntax_test(011_argscope_jumps_01)
syntax_test(011_argscope_jumps_02)
syntax_test(011_argscope_jumps_03)
syntax_test(011_argscope_jumps_04)
syntax_test(011_argscope_jumps_05)
syntax_test(011_argscope_special)
syntax_test(012_var_align)
syntax_test(012_var_alloc)
syntax_test(012_var_array)
syntax_test(012_var_array_init)
syntax_test(012_var_base)
syntax_test(012_var_decl)
syntax_test(012_var_generic)
syntax_test(012_var_img)
syntax_test(012_var_module)
syntax_test(012_var_sampler)
syntax_test(013_name_1)
syntax_test(013_name_2)
syntax_test(013_name_3)
syntax_test(013_name_4)
syntax_test(014_branch)
syntax_test(015_large_memory_model)
syntax_test(015_small_memory_model)
syntax_test(016_literal_conversion)
syntax_test(016_literal_conversions_1_0)
syntax_test(017_addressing)
syntax_test(018_aggregate_const)
syntax_test(019_reg_limit)
